<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="org.limp.basework.Table"%>
<%@ page import="org.limp.basework.analyzer.TableRegisterCenter"%>
<%@ page import="org.limp.mine.StringTool"%>
<%@ page import="jt.classic.system.wordbook.WordBookUtil" %>
<%@ page import="jt.classic.system.user.IUser"%>
<%@ page import="jt.classic.system.ISystem"%>
<%@ page import="jt.classic.system.tablequery.TableQuery"%>
<%@ page import="jt.classic.system.tablequery.TableQueryCenter"%>
<%@ page import="java.util.List" %>
<%
    String context = jt.classic.system.ISystem.getContextPath();

	IUser user = ISystem.getSessionUser(request);
	
	String serverUrl = WordBookUtil.getWordBookItemName("jspparameters", "emapServerURL");
	
	String queryKey = "tracklist";
	
	if(ISystem.matchrole(user, "Supervisor")){
		queryKey = "selftracklist";
	}
	
	if(ISystem.matchrole(user, "SupervisorManager")){
		queryKey = "tracklist";
	}
	
	TableRegisterCenter trc = TableRegisterCenter.getInstance();
	
	List list = trc.findAll("app_ns_trackbak.table");
%>
<html>
<head>
<script src='<%=serverUrl %>'  type='text/javascript'></script>
</head>
<jsp:include page="../head.jsp"></jsp:include>
<script type="text/javascript" src="<%=context %>/app/maps/js/historytrackmap.js"></script>
<link rel="stylesheet" type="text/css" href="<%=context %>/app/maps/css/track.css" />
<script type="text/javascript">
var tableData = [];
<%
    if(list != null && !list.isEmpty()){
    	for(int i=0;i<list.size();i++){
    		Table table = (Table)list.get(i);
    		out.println("tableData.push(['" + table.getName() + "', '" + table.getDescription() + "']);");
    	}
    }
%>
</script>
<body onload="javascript:init('<%=queryKey %>');">
</body>
</html>